const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')

module.exports = {
    entry: './src/index.js',
    mode: "production", // "production" | "development" | "none
    devtool: 'inline-source-map',
    devServer: {
        static: './dist',
        hot: true,
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: 'Hot Module Replacement',
            template: 'src/index.html'
        }),
        new CopyWebpackPlugin({
            patterns: [{
                from: path.join(__dirname, 'public'),
                to: 'public',
                globOptions: {
                    ignore: [
                        '**/.*'
                    ]
                }
            }]
        })
    ],
    output: {
        filename: 'mark_red.js',
        path: path.resolve(__dirname, 'dist'),
        clean: true
    },
    performance: {
        maxEntrypointSize: 10000000,
        maxAssetSize: 30000000
    }
};